<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <hello></hello>
    </div>
    <script src="vue.js"></script>
    <script>
        Vue.component('hello',{
            template:`
            <div>
            <h1>this is hello component</h1>
            <p>my name is {{name}}</p>
            <button @click="fn">sex</button>
            </div>`,
            data:function () {
                return{
                    name:'jack'
                }
            },
            methods:{
                fn(){
                    this.name='rose'
                }
            }
        });
        let vm=new Vue({
            el:'#app',
            data:{

            }
        })
    </script>
</body>
</html>